package com.tjcd.project.library_base.common.basicInfor;


import com.blankj.utilcode.util.PathUtils;
import com.tjcd.project.library_base.BaseApplication;

import java.io.File;

/**
 * @Author jiangKunKun
 * @CreateDate 2022/3/21
 * @Description 基础下载路径
 * @SpittingGrooves
 */
public class BaseDownUrl {

    public static final String DOWNLOAD = "/Download";
    public static final String LABOR = "/labor";
    public static final String COMPANYLOGO = "/CompanyLogo";

    public static final String TEMP = "/Temp";

    /**
     * 自定义路径
     * BaseDownUrl.DOWNLOAD
     * @param Url
     * @return
     */
    public static String getCustomizeUrl(String Url){
        File file = new File(BaseApplication.getInstance().getExternalFilesDir(null) + Url);
        if (!file.exists()){
            file.mkdirs();
        }
        return file.getAbsolutePath() + "/";
    }

    /**
     * 相册路径
     * BaseDownUrl.DOWNLOAD
     * @param Url
     * @return
     */
    public static String getPhotoAlbum(String Url){
        File file = new File(PathUtils.getExternalDcimPath() + "/Camera" + Url);
        if (!file.exists()){
            file.mkdirs();
        }
        return file.getAbsolutePath() + "/";
    }
}
